#ifndef __ULGFX_BALLS_H__
#define __ULGFX_BALLS_H__

#include "ULCore_Balls.h"
#include "VSDL_image.h"
#include "VSDL_text.h"

#define ULG_BALLS_F_RED_BALL_IMAGE_SET		1
#define ULG_BALLS_F_BLUE_BALL_IMAGE_SET		(1 << 1)
#define ULG_BALLS_F_IMAGES_READY		(3)
#define ULG_BALLS_F_FONT_COLOR_SET		(1 << 2)

class ULG_Ball{
private:
	int currentAlpha;
	bool incAlpha;
public:
	VSDL_Image ballImage;
	VSDL_Text msg; //Used for output ball number
	int fontWidth;
	int fontHeight;
	int ballWidth;
	int ballHeight;
public:
	ULG_Ball()
	{
	}

	ULG_Ball(const char *ballImageFile, VSDL_RGB colorkey);
	int LoadImageFile(const char *ballImageFile, VSDL_RGB colorkey);
	int Show(SDL_Surface *destSurf, VSDL_Point leftTopXY);
	void SetNumber(int number);
	void SetFont(VSDL_Font *font);
};

class ULG_Balls : public ULC_Balls{
private:
	unsigned char initFlags;
	VSDL_Point startXY; //First ball's coordinates
public:
	ULG_Ball redBall;
	ULG_Ball blueBall;
public:
	ULG_Balls();
	ULG_Balls(const char *redBallImageFile, VSDL_RGB colorkeyRedBall, const char *blueBallImageFile, VSDL_RGB colorkeyBlueBall);
	ULG_Balls(const char *redBallImageFile, VSDL_RGB colorkeyRedBall, const char *blueBallImageFile, VSDL_RGB colorkeyBlueBall, VSDL_Point startXY);
	int LoadImageFiles(const char *redBallImageFile, VSDL_RGB colorkeyRedBall, const char *blueBallImageFile, VSDL_RGB colorkeyBlueBall);
	void SetFirstBallXY(VSDL_Point point);
	void SetBallNumberFont(VSDL_Font *font);
	int Show(SDL_Surface *destSurf);	
	int GetRedBallImageWidth();
	int GetRedBallImageHeight();
	int GetBlueBallImageWidth();
	int GetBlueBallImageHeight();
	ULG_Balls& operator=(const ULC_Balls &ulcBalls);
	ULG_Balls& operator=(const ULG_Balls &ulgBalls);
	friend class ULG_Serial;
};


#endif /*__ULGFX_BALLS_H__*/
